﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:my="clr-namespace:Bewise.Phone">
    <Style TargetType="my:RatingButton">
        <Setter Property="IsEnabled" Value="true" />
        <Setter Property="IsChecked" Value="false" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="my:RatingButton">
                    <Grid Opacity="1" x:Name="grid">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Disabled">
                                </VisualState>
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <DoubleAnimation To="1" Duration="00:00:00" Storyboard.TargetName="star" Storyboard.TargetProperty="StrokeThickness">
                                        </DoubleAnimation>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CheckStates">
                                <VisualState x:Name="Checked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames  Duration="00:00:00.1" Storyboard.TargetName="star" Storyboard.TargetProperty="Fill">
                                            <ObjectAnimationUsingKeyFrames.KeyFrames>
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="{StaticResource PhoneAccentColor}" />
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames.KeyFrames>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unchecked">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="00:00:00.1" Storyboard.TargetName="star" Storyboard.TargetProperty="Fill">
                                            <ObjectAnimationUsingKeyFrames.KeyFrames>
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="Transparent" />
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames.KeyFrames>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>                                    
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border Background="{StaticResource PhoneBackgroundBrush}">
                            <Path x:Name="star" Width="24" Height="23" Stretch="Fill" StrokeThickness="0" StrokeLineJoin="Round" Stroke="{StaticResource PhoneAccentBrush}" Fill="Transparent" Data="F1 M 24,10.2671L 15.26,10.2048L 12.5,1.91182L 9.74,10.2048L 1,10.2671L 8.03423,15.4546L 5.39261,23.7861L 12.5,18.6992L 19.6074,23.7861L 16.9658,15.4546L 24,10.2671 Z "/>
                        </Border>
                    </Grid>
                </ControlTemplate>

            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>